{% extends "./tmplinfo.html" %}

{% block head %}

<title>{{ kwd['breadtilte'] }}</title>

<meta name="keywords" content="{{ kwd['breadtilte'] }}">

<meta name="description" content="{{ kwd['breadtilte'] }}">

<script type="text/javascript">

    var obj = {};

    function change(span) {

        $('span[name="' + $(span).attr('name') + '"]').each(function () {

            if (this.checked && this != span) {

                this.className = "label label-default";

                this.checked = false;

            }

        });

        obj[$(span).attr('name')] = $(span).attr('value');

        span.className = "label label-primary";

        span.checked = true;

        tt = span.value;

        select();

    }

    function select() {

        // 选择之后，将条件放到 url 中，

        var html_condition = window.location.href + '/con';

        var html_pagination = window.location.href + '/num';

        for (var ii in obj) {

            if (obj[ii] != '') {

                html_condition += '/' + ii + '/' + obj[ii];

                html_pagination += '/' + ii + '/' + obj[ii];

            }

        }

        $('#resultSpan').load(html_condition);

        $('#resultFenye').load(html_pagination);
        pushHistory(html_condition,html_pagination);

    }
    function pushHistory(html_condition,html_pagination) {
        var state = {
        title: html_condition,
        url: html_condition,
        page: html_pagination
        };
        window.history.pushState(state, html_condition, '');
        window.history.forward(1);
    }
</script>

<script type="text/javascript">

    $(function () {

        select();

    });
  setTimeout(function () {
        window.addEventListener("popstate", function (e) {

            if (window.history.state != null && window.history.state.url != "") {
                $('#resultSpan').load(window.history.state.url);
                $('#resultFenye').load(window.history.state.page);
            }


        }, false);

    }, 300);
</script>


{% end %}

{% block typebody %}

<div class="container mainbh">

<div class="row">

    <div class="col-sm-8">

        <ol class="breadcrumb">

            <li><a href="/" title="{{ _('Home') }}"> {{ _('Home') }}</a></li>

             <li><a href="/filter/{{pcatinfo.uid}}" title="{{pcatinfo.name}}">{{pcatinfo.name}}</a></li>

            {% if catinfo %}

            <li><a href="/filter/{{catinfo.uid}}" title="{{catinfo.name}}">{{catinfo.name}}</a></li>

            {% end %}

              {% if userinfo and (userinfo.user_name=='admin' or  kwd.get('can_add',False)) %}

            <li>
                <a href="/publish/{{ widget_info['parentid'] }}" class="btn btn-primary btn-sm" title="{{ _('Publish') }} {{ widget_info['catname'] }} {{ _('data') }}">

               {{ _('Publish') }}   {{ widget_info['catname'] }} {{ _('data') }} </a>

            </li>

            {% end %}

        </ol>

        <ul class="list-group">

            {% block infolist %} {% end %}

        </ul>

        <div class="clear"></div>

        <div class="iga_pagination">

            <span id="resultFenye"></span>

        </div>

        <div class="clear"></div>



        <br>

    </div>

    <div class="col-sm-4">


        <div class="panel panel-black">
            <div class="panel-heading">
                {{ _('Filter') }}
            </div>
            <ul class="list-group">
                {% block infoselect %} {% end %}
            </ul>
        </div>

        <div class="panel panel-black">

            <div class="panel-heading">

                <span class="title colorme">

                {% for taginfo in cat_enum %}

                {% if taginfo.uid.endswith('00') %}

                {{ taginfo.name }}

                {% end %}

                {% end %}

                </span>

            </div>

            <ul class="list-group">

                {% for taginfo in cat_enum %}

                {% if not taginfo.uid.endswith('00') %}

                <li class="list-group-item"><a href="/filter/{{ taginfo.uid }}" title="{{ taginfo.name }}">{{ taginfo.name }}</a></li>

                {% end %}

                {% end %}

            </ul>

        </div>

    </div>

</div></div>

{% end %}